﻿/*
 *  This program is free software; you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation; either version 2 of the License, or
 *  (at your option) any later version.
 *
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with this program; if not, write to the Free Software
 *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 */

namespace SharpMixLib
{
    /// <summary>
    /// 
    /// </summary>
    public class RegisterManager : SingletonManager<RegisterManager>
    {
        /// <summary>
        /// 
        /// </summary>
        private Word accum = new Word();

        /// <summary>
        /// 
        /// </summary>
        private Word extended = new Word();

        /// <summary>
        /// 
        /// </summary>
        private Word[] index_registers = new Word[6];

        /// <summary>
        /// 
        /// </summary>
        private Word jump = new Word();

        #region Accessors
        /// <summary>
        /// 
        /// </summary>
        public Word rA
        {
            get
            {
                return accum;
            }
            set
            {
                accum = value;
            }
        }

        /// <summary>
        /// 
        /// </summary>
        public Word rX
        {
            get
            {
                return extended;
            }
            set
            {
                extended = value;
            }
        }

        /// <summary>
        /// 
        /// </summary>
        public Word rI1
        {
            get
            {
                return index_registers[0];
            }
            set
            {
                index_registers[0] = value;
            }
        }

        /// <summary>
        /// 
        /// </summary>
        public Word rI2
        {
            get
            {
                return index_registers[1];
            }
            set
            {
                index_registers[1] = value;
            }
        }

        /// <summary>
        /// 
        /// </summary>
        public Word rI3
        {
            get
            {
                return index_registers[2];
            }
            set
            {
                index_registers[2] = value;
            }
        }

        /// <summary>
        /// 
        /// </summary>
        public Word rI4
        {
            get
            {
                return index_registers[3];
            }
            set
            {
                index_registers[3] = value;
            }
        }

        /// <summary>
        /// 
        /// </summary>
        public Word rI5
        {
            get
            {
                return index_registers[4];
            }
            set
            {
                index_registers[4] = value;
            }
        }

        /// <summary>
        /// 
        /// </summary>
        public Word rI6
        {
            get
            {
                return index_registers[5];
            }
            set
            {
                index_registers[5] = value;
            }
        }

        /// <summary>
        /// 
        /// </summary>
        public Word[] IndexRegisters
        {
            get
            {
                return index_registers;
            }
            set
            {
                index_registers = value;
            }
        }

        /// <summary>
        /// 
        /// </summary>
        public Word rJ
        {
            get
            {
                return jump;
            }
            set
            {
                jump = value;
            }
        }
        #endregion
    }
}
